//
//  KLAppDelegate.m
//  Koala
//
//  Created by cao pan on 11/22/14.
//  Copyright (c) 2014 Anonymous. All rights reserved.
//

#import "KLAppDelegate.h"
#import "KLMainViewController.h"
#import "KLFirstInViewController.h"
#import "KLMyCenterViewController.h"

#define FIRSTLOGIN  YES

@implementation KLAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.window.backgroundColor = [UIColor whiteColor];
    [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
    if (FIRSTLOGIN) {
        [self setupFirstInViewController];
    }else{
        [self setupMainController];
    }
    return YES;
}


- (void)setupMainController
{
    KLMainViewController * mainController = [[KLMainViewController alloc] init];
    UINavigationController * controller = [[UINavigationController alloc] initWithRootViewController:mainController];
    [self.window setRootViewController:controller];
    [self.window makeKeyAndVisible];
}

- (void)setupFirstInViewController
{
    KLFirstInViewController * firstInController = [[KLFirstInViewController alloc] init];
    [self.window setRootViewController:firstInController];
    [self.window makeKeyAndVisible];
    
    /*
    KLMyCenterViewController *myCenterController = [[KLMyCenterViewController alloc] init];
    UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:myCenterController];
    [self.window setRootViewController:controller];
    [self.window makeKeyAndVisible];
    */
    
}

- (void)applicationWillResignActive:(UIApplication *)application
{
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
